package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;

@AllArgsConstructor
@Getter
public enum MallOrderStatusEnum {
    TIMEOUT_CANCEL(0, "超时取消"),
    WAIT_PAY(1, "待付款"),//已下单未付款
    WAIT_RECEIPT(2, "待发货"),//已付款,未发货
    TO_BE_RECEIPT(3, "待收货"),//已发货,未收货
    RECEIPT(4, "已收货"),
    FINISH(5, "订单完成"),
    CLOSURE(6, "订单关闭"),
    ;
    @EnumValue
    private int code;
    private String description;


    /**
     * 仅退款 可以发起售后状态
     *
     * @return
     */
    public static ArrayList<MallOrderStatusEnum> getIsRefundStatus() {
        ArrayList<MallOrderStatusEnum> list = Lists.newArrayList();
        list.add(WAIT_RECEIPT);//已付款,未发货
        list.add(TO_BE_RECEIPT);//已发货,未收货
        list.add(RECEIPT); //已收货
        list.add(FINISH);  //已完成
        return list;
    }

    /**
     * 退货退款 换货 可以发起售后状态
     *
     * @return
     */
    public static ArrayList<MallOrderStatusEnum> getSecondIsRefundStatus() {
        ArrayList<MallOrderStatusEnum> list = Lists.newArrayList();
        list.add(TO_BE_RECEIPT);//已发货,未收货
        list.add(RECEIPT); //已收货
        list.add(FINISH);  //已完成
        return list;
    }
}
